#include <QCoreApplication>
#include <iostream>
using namespace std;
int main()
{
    int A, B, C;
    int b = 0, a = 0;
    cout << "Enter A: ";
    cin >> A;
    cout << "Enter B: ";
    cin >> B;
    cout << "Enter C: ";
    cin >> C;
    while (A >= C) {
        A -= C;
        while (B >= C) {
            ++b;
            B -= C;
        }
        a+=b;
    }
    cout <<a<<endl;
    return 0;
}
